import request from '@/utils/request'

// 查询自我评价结果列表
export function listEvaluation(query) {
  return request({
    url: '/evaluation/selfEvaluation/list',
    method: 'get',
    params: query
  })
}

// 根据memberId查询自我评价
export function listEvaluationByMemberId(memberId) {
  return request({
    url: '/evaluation/selfEvaluation/list/' + memberId,
    method: 'get',
  })
}

// 查询自我评价结果详细
export function getEvaluation(id) {
  return request({
    url: '/evaluation/selfEvaluation/' + id,
    method: 'get'
  })
}

// 新增自我评价结果
export function addEvaluation(data) {
  return request({
    url: '/evaluation/selfEvaluation',
    method: 'post',
    data: data
  })
}

// 保存评价结果
export function saveEvaluation(data, memberId){
  return request({
    url: '/evaluation/selfEvaluation/save/' + memberId,
    method: 'post',
    data: data
  })
}

// 修改自我评价结果
export function updateEvaluation(data) {
  return request({
    url: '/evaluation/selfEvaluation',
    method: 'put',
    data: data
  })
}

// 删除自我评价结果
export function delEvaluation(id) {
  return request({
    url: '/evaluation/selfEvaluation/' + id,
    method: 'delete'
  })
}
